<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var a = Number(prompt('请输入一个数字'))
    // if (a % 2 === 0) {
    //   console.log('a是偶数')
    // } else {
    //   console.log('a是奇数')
    // }

    if (a % 2) {
      // 1 是true,奇数
      console.log('a是奇数')
    } else {
      console.log('a是偶数')
    }
  </script>
</body>
</html>